# 假设这是文件路径
file_path = 'your_file_path.txt'
# 临时文件路径，用于存储处理后的内容
temp_file_path = 'temp_file.txt'

# 标记是否开始删除块内容
delete_block = False

# 读取原文件并写入临时文件，跳过需要删除的块
with open(file_path, 'r', encoding='utf-8') as read_file, \
     open(temp_file_path, 'w', encoding='utf-8') as write_file:
    for line in read_file:
        # 检查是否开始新的块，如果是则开始忽略内容
        if line.strip() == "building_gold_mine = {":
            delete_block = True
            continue  # 跳过当前行不写入
        # 当前行以'}'开始，表示结束标记，重置flag并继续处理下一行
        elif line.startswith('}'):
            delete_block = False
            continue  # 直接跳过写入此结束行
        # 如果不在删除范围内，则写入该行
        elif not delete_block:
            write_file.write(line)

# 删除原文件并把临时文件重命名为原文件
import os
os.remove(file_path)
os.rename(temp_file_path, file_path)